<template>
    <div class="userDetails">
        <el-tabs v-model="activeName" :tab-position="tabPosition" @tab-click="handleClick">
            <el-tab-pane label="基本信息" name='基本信息'>
                <information ref='information' @userToken='userToken'></information>
            </el-tab-pane>
            <el-tab-pane label="订单记录" name='订单记录'>
                <recordOrder ref='recordOrder'></recordOrder>
            </el-tab-pane>
            <el-tab-pane label="直推会员" name='直推会员'>
                <pushMember ref='pushMember'></pushMember>
            </el-tab-pane>
            <el-tab-pane label="充值记录" name='充值记录'>
                <withdrawals ref='withdrawals'></withdrawals>
            </el-tab-pane>
            <el-tab-pane label="提现记录" name='提现记录'>
                <recharge ref='recharge'></recharge>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>


<script>
import information from './userDetailsComponents/information'
import recordOrder from './userDetailsComponents/recordOrder'
import pushMember from './userDetailsComponents/pushMember'
import withdrawals from './userDetailsComponents/withdrawals'
import recharge from './userDetailsComponents/recharge'
export default {
    name:'userDetails',
    data(){
        return {
            tabPosition:'top',
            activeName:'基本信息',
            token:''
        }
    },
    methods:{
        handleClick(){
            switch (this.activeName) {
                case "基本信息":
                    this.$refs.information.movieDetails();
                    break;
                case "订单记录":
                    this.$refs.recordOrder.getData();
                    break;
                case "直推会员":
                    this.$refs.pushMember.getList();    
                    break;
                case "充值记录":
                    this.$refs.withdrawals.getBill();    
                    break;
                case "提现记录":
                    this.$refs.recharge.getBill();    
                    break;    
            }
        },
        userToken(token){
            console.log(token);
            this.token = token;
        },
    },
    components:{
        information,
        recordOrder,
        pushMember,
        withdrawals,
        recharge
    }
}
</script>

<style lang="less" scoped>
.userDetails{
    padding: 1rem;
}
</style>

